package com.icehelper.hades.base.controller;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @description: 分页对象
 * @author: xingcheng
 * @time: 2020-12-15
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PageVo {

    private Integer pageNum = 1;

    private Integer pageSize = 20;

    private Integer offset;


    public static PageVo build(Integer pageNum, Integer pageSize) {
        int offset = (pageNum - 1) * pageSize;
        return new PageVo(pageNum, pageSize, offset);
    }
}
